package com.atguigu.gmall.pay.controller;

import com.alipay.api.AlipayApiException;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.pay.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lfy
 * @Description
 * @create 2023-08-04 15:35
 */
@RequestMapping("/api/payment")
@RestController
public class PayController {


    @Autowired
    PayService payService;
    @GetMapping("/alipay/submit/{orderId}")
    public String payPage(@PathVariable("orderId") Long orderId) throws AlipayApiException {

        String html = payService.generatePayPage(orderId);

        return html;
    }
}
